var ValidateForm = new Class({
	initialize: function (form, options){
		// opts de base
		var defOpts = {
			onElementValidate: function(isValid, field, className, warn){
				var label = $(getLabel(field));
				if(label && isValid) {
					label.removeClass("validation-failed");
				}
				else if(label) label.addClass("validation-failed");
			},
			onElementFail: function (field, validatorsFailed){},
			scrollToErrorsOnSubmit: false,
			evaluateOnSubmit: true,
			evaluateFieldsOnBlur: true,
			evaluateFieldsOnChange: true,
			serial: false
		}
		
		// modif opts
		for(var o in options){
			defOpts[o] = options[o];
		}
		
		// instance
		new FormValidator.Inline(form, defOpts);
	}
});
Moodule.register("ValidateForm", "form.toValidate");
Moodule.register("ValidateForm", "form.toValidateOnBlur", {evaluateFieldsOnBlur:true});
